﻿{include file="/public/header" /}
<div class="content-wraper full">
    <div class="tabs-link-wrap" level="first">
        <div class="tabs-link-scroll">
        <!--{foreach $nav as $key => $row}-->
            <a href="{$_G['_mca_']}/nkey/{$key ?? ''}" {if $key==$nkey}class="active"{/if}>{$row['title'] ?? ''}</a>
        <!--{/foreach}-->
        </div> 
    </div>
    <!--{if ($nkey ?? '')=='state5' AND $_C->auth(4,'partner')}-->
    <div class="tools-bar">
        <a data-key="agree"><i class="fa fa-check"></i> 同意</a>
        <a data-key="refuse"><i class="fa fa-times"></i> 拒绝</a>
    </div>
    <div class="normal-line"></div>
    <!--{/if}-->
    <div class="search_wraper" style="min-height: 51px;">
        <form class="normal_form search_form" onsubmit="return false;">
            <div class="condition" onscroll="Core.scrolling(this)">
            </div>
            <div class="row form-footer-bar">
                <button class="btn" type="reset" role="btn-cancel">重置</button>
                <button r-button class="btn btn-primary search-btn" type="submit" role="btn-submit">搜索</button>
                <button r-button style="display: none;" class="btn switch_search filter">展开搜索条件<i class="fa fa-angle-down"></i></button>
                <div style="margin: 10px 0 -10px;"><a class="search_close"><i class="fa fa-angle-up"></i>收起</a></div>
            </div>
        </form>
    </div>
    <div class="table_box">
        <table class="table_main" id="datalist"></table>
    </div>
</div>
<script type="text/javascript">
Core.Easyui.FieldColumn = [
    {field:'mobile',title:'手机号',width:120,align:'center', search: true, nowsearch: false, searchtype: 'input'},
    {field:'realname',title:'真实姓名',width:120,align:'center', search: true, nowsearch: false, searchtype: 'input'},
    {field:'bankname',title:'开户银行',width:180,align:'center'},
    {field:'bankac',title:'银行账户',width:220,align:'center', search: true, nowsearch: false, searchtype: 'input'},
    {field:'amount',title:'申请体现佣金(元)',width:130,align:'center'},
    {field:'cktime',title:'审核时间',width:140,align:'center'},
    {field:'paytime',title:'提现时间',width:140,align:'center'},
    {field:'state',title:'状态',width:120,align:'center',formatter:function(value,row,index){
		return ['-','<span style="color:green">已付款</i>','<span>待付款</span>','','<span style="color:red">驳回申请</span>','申请'][value] || '';
	}},
    {field:'dateline',title:'申请时间',width:140,align:'center'},
    {field:'content',title:'审核回复',width:320,align:'left'},
	{field:'sysmsg',title:'系统消息',width:220,align:'left'},
];
Core.Easyui.FrozenColumn = [
    {field:'ck',checkbox:true,width:30},
    {field:'id',title:'ID',width:50,align:'center'},
	{field:'nickname',title:'花名',width:220,align:'left', search: true, nowsearch: true, searchtype: 'input'},
];

Core.Easyui.init($("#datalist"), {
    url: "{$_G['_mc_'] ?? ''}/ajax/nkey/{$nkey ?? ''}",
    idField: "id",
    fitColumns: false,
    singleSelect : true,
    columns: [Core.Easyui.FieldColumn],
    frozenColumns: [Core.Easyui.FrozenColumn],
    pageSize: 50,
},$(".search_form"));


Core.Sys.Action = function(Tkey,row){
    switch(Tkey){
        case 'agree':
            var row = $('#datalist').datagrid('getSelected');
            if (!row) {
                Core.Dialog.msg('请选择要拒绝的申请');return;
            }
            Core.Dialog.open({'title': '提现汇款','width': '650px','height': '350px','url': "{$_G['_mc_'] ?? ''}/agree/id/"+row.id});
        break;
        case 'refuse':
            var row = $('#datalist').datagrid('getSelected');
            if (!row) {
                Core.Dialog.msg('请选择要拒绝的申请');return;
            }
            Core.Dialog.open({'title': '拒绝提现申请','width': '650px','height': '350px','url': "{$_G['_mc_'] ?? ''}/refuse/id/"+row.id});
        break;
    }
    return;//unordertonet
}
$(document).ready(function(){
    $('.tools-bar').find('a[data-key]').on('click',function(){
        var Tkey = $(this).attr('data-key');
        if (!Core.rule('key',Tkey)) return false;
        Core.Sys.Action(Tkey);
    });
});

/**搜索 */
var Table_Filters = Core.Search.searchArray();
var filterType = Core.Search.typeList();
//var rsourceUrl = "/index/ajax/index"; //搜索字段基础数据
//var regionUrl = "/index/ajax/district/level/"; //城市搜索字段
Core.Search.initFilter(null,null);
</script>
{include file="/public/footer" /}